<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>后台管理面板</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    {include file="common/top" /}
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <div class="content-wrapper" style="margin-left: 0 !important;">
        <!--页眉-->
        <section class="content-header">
            <h1>
                <!--首页-->
                <small><i class="fa fa-dashboard"></i> </small>
            </h1>
            <ol class="breadcrumb">
                <!--<li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>-->
                <li class="active"></li>
            </ol>
        </section>
        <!--内容开始-->
        <section class="content">
                <div class="search">
                        <form class="form-inline" action="">
                            <a class="btn btn-flat btn-success m_10 f_r" onclick="javascript :history.back(-1)"><i class="fa fa-undo m-r-10"></i>返 回</a>
                        </form>
                    </div>
        <form method="post" id="form_data">
            <input type="hidden" value="{$orderInfo.id}" name="id">
                <!---->
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="box box-body">
                        <!---->
                        <div class="row dd_input_group">
                            <div class="form-group">
                                <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">文章标题</label>
                                <div class="col-xs-7 col-sm-6 col-md-4 col-lg-4">
                                    <input type="text" name="title" class="form-control" placeholder="请输入文章标题" value="{$orderInfo.title}">
                                </div>
                                <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">
                                </div>
                            </div>
                        </div>

                        <div class="row dd_input_group">
                            <div class="form-group">
                                <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">作者</label>
                                <div class="col-xs-7 col-sm-6 col-md-4 col-lg-4">
                                    <input type="text" name="author" class="form-control" value="{$orderInfo.author}" placeholder="请输入作者">
                                </div>
                                <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">
                                </div>
                            </div>
                        </div>

                        <div class="row dd_input_group">
                            <div class="form-group">
                                <div class="col-xs-12 col-sm-11 col-md-10 col-lg-8">
                                    <label class="text-lable">内容</label>
                                    <!-- class="form-control" -->
                                    <textarea  name="content" id="content" rows="15" placeholder="请输入内容">{$orderInfo.content}</textarea>
                                </div>
                            </div>
                        </div>
                        <!---->
                        <div class="row dd_input_group">
                            <div class="form-group">
                                <div class="col-xs-12 col-sm-8 col-md-6 col-lg-5 text-center">
                                    <button type="button" class="btn btn-flat btn-primary " id="button">提 交</button>
                                    <button type="button" class="btn btn-flat btn-default" onclick="javascript :history.back(-1)">返 回
                                    </button>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!-- /.box -->
                </div>
            </div>
        </form>
    </section>
    </div>
    <!-- /.row (main row) -->

    </section>
    <!--内容结束-->
</div>
</div>
{include file="common/bottom" /}
<script src="/static/lib/ueditor/ueditor.config.js"></script>
<script src="/static/lib/ueditor/ueditor.all.js">
</script>
<script>
    $(function () {
        UE.getEditor('content', {initialFrameHeight: 600});
    })
    $('#button').click(function () {
        var data = $('#form_data').serialize();
        $.ajax({
            url: "{:url('admin/download/edit')}",
            type: "POST",
            data: data,
            success: function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {
                        icon: 6,
                        time: 2000
                    }, function () {
                        window.location.reload();
                    })
                } else {
                    layer.open({
                        title: '修改失败！',
                        content: res.msg,
                        icon: 5
                    })
                }
            }
        })
    })
</script>
<script src="/static/lib/layui/layui/layui.js"></script>
<link rel="stylesheet" href="/static/lib/layui/layui/css/layui.css">
<script>
    layui.use('upload', function () {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '.show_img' //绑定元素
            , url: '{:url("index/Img/index")}' //上传接口
            , field: 'upimg'
            , exts: 'jpg|png'
            , done: function (res) {
                //上传完毕回调
                layer.msg(res.msg, {time: 2000}, function () {
                    if (res.code == 1) {
                        $('input[name="show_img"]').val('/uploads/' + res.src);
                    }
                })
            }
            , error: function () {
                //请求异常回调
            }
        });
    });
</script>

<!--引入JS-->
<script type="text/javascript" src="/static/plugins/webuploader-0.1.5/webuploader.js"></script>
</body>
</html>
